home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 1 / Cream of the Crop 1.iso / PROGRAM / CLPRNT24.ARJ / CL-PRINT.ASM next >
Assembly Source File  |  1992-05-03  |  54KB  |  1,023 lines

  1. ;             CL-Print.asm;
  2. CR             Equ  13
  3. LF             Equ  10
  4. BELL           Equ  7
  5. TAB            Equ  9
  6. SWITCH         Equ  '/'
  7.  
  8. CODE SEGMENT                           ;*************************
  9. ASSUME CS:CODE,DS:CODE                 ;*                       *
  10.                Org 100H                ;*  REMEMBER TO EXE2BIN  *
  11.                                        ;*                       *
  12. Start:         Jmp    Beginning        ;*************************
  13.  
  14.  
  15. ;              Data Area
  16. ;              ---------
  17.  
  18. Copyright$     DB  CR,LF,'CL-Print Ver 2.40 - '
  19.                DB  'Copyright 1991,1992 Gary Meeker',CR,LF,'"'
  20. Comment$       DB     62 DUP (' '), CR, LF, 1AH
  21. Quote2$        DB  '"=>$'
  22. File_Start     DW  ?                            ;Points to Asciiz Filename
  23. Commands       DB     'BQN*Z'
  24. BiosDos        DB  0FFH                         ;0=Bios, -1=DOS Time/Date
  25. Quiet          DB  0FFH                         ;0=Quiet, -1=Copyright Display
  26. NoAppend       DB  0FFH                         ;0=No Append, -1=Append
  27. Close_It       DB  0FFH                         ;0=write 62 *'s
  28. ASCIIZ$        DB  ' '                          ;0=ASCIIZ, Space
  29. Usage_Msg      DB  BELL,CR,LF
  30.                DB  'Usage:  CL-PRINT filespec "logstring"',CR,LF,LF
  31.                DB  ' String must be in quotes or decimal ASCII - '
  32.                DB  'Seperate multiple codes by commas.',CR,LF,LF
  33. ;      DB  ' e.g. CL-PRINT C:\PCB\CALLER /S,"Scheduled Event Ended /A"',CR,LF,LF
  34.                DB  TAB,'/A = " at MM-DD-YY HH:MM:SS"',CR,LF
  35.                DB  TAB,'/D = "MM-DD-YY"',CR,LF
  36.                DB  TAB,'/L = "MM-DD-YY (HH:MM)"',CR,LF
  37.                DB  TAB,'/S = 6 spaces',CR,LF
  38.                DB  TAB,'/T = "HH:MM"',CR,LF
  39.                DB  TAB,'/* = row of *',CR,LF
  40.                DB  TAB,'/Q = No console output',CR,LF
  41.                DB  TAB,'/N = Create NEW file'
  42.                DB  TAB,'/B = use BIOS Date/Time Services '
  43. CrLf$          DB  CR,LF,'$'
  44. NoUser$        DB  BELL,CR,LF,'No User Online!',CR,LF,'$'
  45.  
  46. PCBDrive       DB  'PCBDRIVE='
  47. LenPCBDrive    EQU $ - PCBDrive
  48.  
  49. PCBDir         DB  'PCBDIR='
  50. LenPCBDir      EQU $ - PCBDir
  51.  
  52. PCBoardSys$    DB  'PCBOARD.SYS',0
  53. PCBoardDat$    DB  'PCBOARD.DAT',0
  54.  
  55. Not_Found2     DB  ' - File not found! ',CR,LF,'$'
  56. Not_Found3     DB  ' - Path not found! ',CR,LF,'$'
  57. No_Handle      DB  ' - No handles left!',CR,LF,'$'
  58. No_Access      DB  ' - Access Denied!',CR,LF,'$'
  59. Unknown        DB  ' - Unknown Error!',CR,LF,'$'
  60. ReadError$     DB  ' - Error reading file!',CR,LF,'$'
  61.  
  62. ;              Code Area
  63. ;              ---------
  64.  
  65. ;-------------------------------------------------------;
  66. ; First we will parse the filename and the string.      ;
  67. ;-------------------------------------------------------;
  68.  
  69. Beginning:     Mov    DX,OFFSET Usage_Msg    ;Point to syntax message.
  70.                Cld                           ;Move in forward direction.
  71.                Mov    AX,DS                  ;Point ES to DS
  72.                Mov    ES,AX
  73.                Mov    SI,80H                 ;Point to parameters.
  74.                Mov    DI,81H                 ;Point DI for SCASB
  75.                Mov    AL,'@'                 ;See if any @ Variables exist
  76.                Xor    CH,CH                  ;Get Command Line
  77.                Mov    CL,[SI]                ;  Length in CX
  78.                Jcxz   ErrorExit              ;Nevermind if no parameters
  79.                Repne  Scasb                  ;Do we have any @ variables
  80.                Jne    No_Read                ;Nope, None found
  81.                Call   ReadFile               ;Yep, Read PCBoard files into
  82.                Jc     ErrorExit              ;  buffers, oops Error occured
  83. No_Read:       Mov    DI,OFFSET Comment$     ;Point to comment string storage.
  84.                Xor    CX,CX                  ;Set string counter to zero.
  85.                Call   Space                  ;Parse leading spaces.
  86.                Mov    File_Start,SI          ;We now point to filename.
  87.  
  88. File_Byte:     Cmp    BYTE PTR [SI],CR       ;Is it a carriage return?
  89.                Jz     ErrorExit              ;If yes, exit with syntax error.
  90.                Cmp    BYTE PTR [SI],' '      ;Is it a space?
  91.                Jz     Asciiz                 ;If yes, end of filename
  92.                Inc    SI                     ; else, point to next byte
  93.                Jmp    File_Byte              ; and check it.
  94.  
  95. OpenError:     Call   File_Error             ;Show what type of Error
  96. ErrorExit:     Call   Display
  97.                Mov    AX,4C01H
  98.                Int    21H                    ; and terminate.
  99.  
  100. Asciiz:        Mov    BYTE PTR [SI],0        ;Make filename into ASCIIZ.
  101.  
  102.                Call   Space                  ;Parse the spaces.
  103. String_Byte:   Call   String                 ;Get string.
  104.                Cmp    BYTE PTR [SI],CR       ;Are we now pointing to CR?
  105.                Jz     Open_File              ;If yes, we are done here
  106.                Inc    SI                     ; else point to next byte
  107.                Cmp    CX,62                  ;Maximum Length?
  108.                Jl     String_Byte            ; No, get rest of string.
  109.  
  110. ;------------------------------------------;
  111. ; OK, Open file and seek to the end of it. ;
  112. ;------------------------------------------;
  113.  
  114. Open_File:     Push   CX                     ;Save length
  115.                Mov    DX,File_Start          ;Point to ASCIIZ filename
  116.                Cmp    NoAppend, 0            ;Is it NoAppend mode?
  117.                Je     Create_File            ;Yes, Just create it!
  118.                Mov    AX,3D41H               ; Open file for writing.
  119.                Int    21H
  120.                Jnc    Open2                  ;OK if no error
  121.                Cmp    AX,2                   ;Was it NOT FOUND?
  122.                Jne    OpenError              ;  No, Report the error
  123. Create_File:   Mov    AH,3CH                 ;  Yes, Create File
  124.                Xor    CX,CX                  ;       Normal Attribute
  125.                Int    21H
  126.                Jc     OpenError              ;Report the error
  127.  
  128. Open2:         Mov    BX,AX                  ;File Handle to BX
  129.                Mov    AX,4202H               ;No, Move File Pointer
  130.                Xor    CX,CX                  ; Zero offset
  131.                Xor    DX,DX                  ;  from end of file (CX:DX = 0)
  132.                Int    21H
  133.                Pop    CX
  134.  
  135. ;------------------------------------------------;
  136. ; We are ready to write the comment to the file. ;
  137. ;------------------------------------------------;
  138.  
  139. Write:         Jcxz   Skip_Write
  140.                Mov    DX,OFFSET Comment$     ;Point to COMMENT$
  141.                Jmp    SHORT Write_Close      ;Write the comment
  142. Make_Close:    Call   Do_Close               ;Fill the Buffer
  143. Write_Close:   Mov    CX,64                  ;64 Bytes to write
  144.                Mov    AH,40H                 ; and write comment.
  145.                Int    21H
  146. Skip_Write:    Cmp    Close_It,0FFH          ;Do we need a row of *,s
  147.                Jne    Make_Close             ;yes
  148.                Mov    AH,3EH                 ;No,close file.
  149.                Int    21H
  150.                Cmp    Quiet,0FFh             ;Quiet Mode
  151.                Jne    QExit                  ;Yes, So Exit
  152.                Mov    Comment$+62,'$'        ;No, prepare the Comment
  153.                Mov    DX,OFFSET Copyright$   ;Point to Copyright message
  154.                Call   Display
  155.                Mov    DX,OFFSET Quote2$      ;Print trailing Quote & Arrow
  156.                Call   Display
  157.                Mov    SI,File_Start          ;Point to File Name
  158.                Call   DisplayText
  159.  
  160. ;------------------------------------------;
  161. ; The exit is placed in the middle of code ;
  162. ; so it can be reached by short jumps.     ;
  163. ;------------------------------------------;
  164.  
  165. Exit2:         Mov    DX,OFFSET CrLf$
  166. Exit:          Call   Display
  167. QExit:         Mov    AX,4C00H
  168.                Int    21H                    ; and terminate.
  169.  
  170. File_Error:    Mov    DX,OFFSET Not_Found2
  171.                Cmp    AX,2
  172.                Je     Error_Ret
  173.                Mov    DX,OFFSET Not_Found3
  174.                Cmp    AX,3
  175.                Je     Error_Ret
  176.                Mov    DX,OFFSET No_Handle
  177.                Cmp    AX,4
  178.                Je     Error_Ret
  179.                Mov    DX,OFFSET No_Access
  180.                Cmp    AX,5
  181.                Je     Error_Ret
  182.                Mov    DX,OFFSET Unknown
  183. Error_Ret:     Ret
  184.  
  185. ;---------------------------------------;
  186. ; This subroutine will use DOS function ;
  187. ; to print string terminated by '$'     ;
  188. ;---------------------------------------;
  189.  
  190. Display:       Mov    AH,9                   ;Display message
  191.                Int    21H                    ;
  192.                Ret                           ;
  193.  
  194.  
  195. ;---------------------------------------------;
  196. ; This subroutine will get the quoted string  ;
  197. ; or convert the decimal ASCII to hexadecimal ;
  198. ; and store in the appropriate storage area.  ;
  199. ;---------------------------------------------;
  200.  
  201. String:        Mov    AH,[SI]                ;Get a character
  202.                Cmp    AH,'"'                 ;Is it double quotes?
  203.                Jz     Got_Quote              ;Yes -
  204.                Cmp    AH,"'"                 ;No  - Is it single quotes?
  205.                Jnz    Number                 ;If no, must be number
  206. Got_Quote:     Inc    SI                     ; else, point to first string
  207. Next_String:   Lodsb                         ; byte and retrieve.
  208.                Cmp    AL,CR                  ;Is it carriage return?
  209.                Jz     Exit                   ;If yes, syntax error; exit.
  210.                Cmp    AL,SWITCH              ;Is it a Switch character
  211.                Jz     Is_Switch              ;Yes
  212.                Cmp    AL,'@'                 ;No, Is it a Var Subst Char?
  213.                Jnz    Not_switch             ;No,
  214. Is_Switch:     Call   Substitute             ;Yes, Substitute
  215.                Jnc    Next_2                 ; If Not carry then continue
  216.                Ret                           ; else done
  217. Not_Switch:    Cmp    AL,AH                  ;Is it a matching quotes?
  218.                Jnz    Store                  ;If no, store the byte
  219.                Call   Delimiter              ; else, see if delimiter
  220.                Jnc    Store                  ; and store the quote if part
  221.                Ret                           ; of string else, we are done.
  222.  
  223. Store:         Stosb                         ;Store the byte
  224.                Inc    CX                     ; increment byte count
  225. Next_2:        Cmp    CX,62                  ;Maximum length?
  226.                Jl     Next_String            ; no, get next string byte
  227.                Ret                           ; yes, then return
  228.  
  229. ;-------------------------------;
  230. ; This routine converts Decimal ;
  231. ; Ascii number to charcater and ;
  232. ; places it in Comment$         ;
  233. ;-------------------------------;
  234.  
  235. Number:        Xor    BL,BL                  ;Zero into hex counter.
  236.                Cmp    AH,Switch              ;Was it a Switch character?
  237.                Jz     Is_Switch2             ;Yes
  238.                Cmp    AH,'@'                 ;No, Is it a Var Subst char?
  239.                Jnz    Get_Number             ;No, must be a number
  240. Is_Switch2:    Inc    SI                     ;Yes, Skip the Switch Char
  241.                Mov    AL,AH                  ;Copy Switch to AL
  242.                Jmp    SHORT Substitute       ;Do the substitute
  243. Get_Number:    Call   Delimiter              ;Is it a delimiter?
  244.                Jnc    Load_Number            ;If no, get next decimal number
  245.                Mov    AL,BL                  ; get hex byte
  246.                Stosb                         ; and store
  247.                Inc    CX                     ; increment byte count
  248.                Ret                           ; yes, then return
  249. Jump2Exit:     Jmp    Exit
  250.  
  251. Load_Number:   Lodsb                         ;Get the decimal number
  252.                Cmp    AL,'0'                 ;Is it between 0 and 9?
  253.                Jb     Jump2Exit              ;If no, syntax error
  254.                Cmp    AL,'9'
  255.                Ja     Jump2Exit
  256.                Sub    AL,30H                 ; else, convert to hex
  257.                Mov    BH,AL                  ; and save
  258.                Mov    AL,10                  ; multiply by ten
  259.                Mul    BL                     ; to shift place left
  260.                Mov    BL,AL
  261.                Add    BL,BH                  ; add new number
  262.                Jmp    Get_Number             ; and get next decimal number.
  263.  
  264. ;------------------------------------------------;
  265. ; This subroutine converts '/' variables to      ;
  266. ; their values and stuffs Comment$               ;
  267. ;------------------------------------------------;
  268.  
  269. Substitute:    Push   AX                     ;Save Quote
  270.                Mov    AH,AL                  ;Save the switch
  271.                Lodsb                         ;Get the next Character
  272.                Cmp    AL,'a'                 ;Lower Case?
  273.                Jb     S1                     ;No,
  274.                Cmp    AL,'z'                 ;Maybe, let's see
  275.                Ja     S1                     ;No,
  276.                Sub    AL,20h                 ;Yes, convert to Upper Case
  277. S1:            Cmp    AH,Switch              ;Is it a switch or Var Subst?
  278.                Je     Do_Switch              ;It was a Switch?
  279.                Jmp    VarSub                 ;No, It was a Var Subst?
  280. Do_Switch:     Mov    BX,5                   ;5 commands to check
  281. Next_Cmp:      Cmp    AL,Commands-1[BX]      ;Is this the one?
  282.                Je     Set_Mode               ;Yes
  283.                Dec    BX                     ;No, Decrement BX
  284.                Jnz    Next_Cmp               ;Loop until Done
  285. ;---------------------------------------------------------------------------
  286. ;               Cmp    AL,'Q'                 ;Is it QUIET Switch?
  287. ; code          Je     Set_Quiet              ;Yes (Carry is Cleared)
  288. ; replaced      Cmp    AL,'N'                 ;Is it NoAppend mode?
  289. ; by 5          Je     Set_NoAppend           ;Yes, (Carry is Cleared)
  290. ; lines         Cmp    AL,'B'                 ;Is it BIOS services mode?
  291. ; above         Je     Set_TimeDate           ;Yes, (Carry is Cleared)
  292. ;                Cmp    AL,'*'                 ;No, Is it CLOSED Var?
  293. ;               Je     Set_Closed             ;Yes (Carry is Cleared)
  294. ;               Cmp    AL,'Z'                 ;Is it a ASCIIZ var?
  295. ;               Je     Set_ASCIIZ             ;Yes, Carry is Cleared
  296. ;---------------------------------------------------------------------------
  297.                Cmp    AL,CR                  ;Is it CR?
  298.                Je     Jump2Exit              ;If yes, syntax error; exit.
  299.                Mov    BX,DI                  ;Save COMMENT$ Pointer
  300.                Mov    DI,OFFSET DatBuffer    ;Point to Buffer
  301.                Cmp    AL,'T'                 ;Is it TIME var?
  302.                Je     Stuff_Time             ;Yes, and Carry is Clear
  303.                Cmp    AL,'D'                 ;Is it DATE Var?
  304.                Je     Stuff_Date             ;No,
  305.                Cmp    AL,'A'                 ;Maybe, let's see
  306.                Jnz    S2                     ;No,
  307.                Mov    AX,'a '                ;Yes, Set ' at ' in Buffer
  308.                Stosw                         ;
  309.                Mov    AX,' t'                ;
  310.                Stosw                         ;
  311.                Call   Do_Date                ;add Date to Buffer
  312.                Mov    AL,' '                 ;add ' '
  313.                Stosb                         ;
  314.                Stc                           ;We want seconds too
  315. Stuff_Time:    Call   DO_Time                ;add Time to Buffer
  316.                Jmp    SHORT Stuff_It
  317. S2:            Cmp    AL,'L'                 ;Is it LOGON Var?
  318.                Jne    S3                     ;No,
  319.                Call   Do_Date                ;Yes, Set Date in Buffer
  320.                Mov    AX,'( '                ; add ' ('
  321.                Stosw                         ;
  322.                Clc                           ;We don't want seconds
  323.                Call   Do_Time                ;add Time to Buffer
  324.                Mov    AL,')'                 ; add ')'
  325.                Stosb                         ;
  326.                Jmp    SHORT Stuff_It
  327. S3:            Cmp    AL,'S'                 ;Is it SPACES var?
  328.                Jne    S4                     ;No,
  329.                Mov    AX,'  '                ;Yes, Set six spaces in Buffer
  330.                Stosw                         ;
  331.                Stosw                         ;
  332.                Stosw                         ;
  333.                Jmp    SHORT Stuff_It
  334. S4:            Mov    DI,BX                  ;restore Comment$ pointer
  335.                Stosb                         ;just store it
  336.                Inc    CX                     ;count it
  337.                Clc                           ;
  338.                Pop    AX                     ;Restore Quote
  339.                Ret
  340. Set_Mode:      Mov    BiosDOS-1[BX],BH       ;Handles all 5 Set variables, BH=0
  341.                Pop    AX                     ;Restore Quote
  342.                Ret                           ;Done - Carry Clear
  343.  
  344. ;---------------------------------------------------------------------------
  345. ;Set_ASCIIZ:    Mov    BYTE PTR ASCIIZ$,0     ;Set 0 in ASCIIZ$
  346. ;               Pop    AX                     ;Restore Quote
  347. ;               Ret                           ;Done - Carry Clear
  348. ;Set_Quiet:     Mov    BYTE PTR Quiet,0       ;Show Quiet mode
  349. ;               Pop    AX                     ;Restore Quote
  350. ;               Ret                           ;Done - Carry Clear
  351. ;Set_NoAppend:  Mov    BYTE PTR NoAppend,0    ;Show NoAppend mode
  352. ;               Pop    AX                     ;Restore Quote
  353. ;               Ret                           ;Done - Carry Clear
  354. ;Set_TimeDate:  Mov    BYTE PTR BiosDos,0     ;Show BIOS Services used
  355. ;               Pop    AX                     ;Restore Quote
  356. ;               Ret                           ;Done - Carry Clear
  357. ;Set_Closed:    Mov    BYTE PTR Close_It,0    ;Show Closed mode
  358. ;               Pop    AX                     ;Restore Quote
  359. ;               Ret                           ;Done - Carry Clear
  360. ;---------------------------------------------------------------------------
  361.  
  362.  
  363. Stuff_Date:    Call   Do_Date                ;Yes, Set Date in Buffer
  364. Stuff_It:      Xor    AL,AL                  ;Zero marks end of data
  365.                Stosb                         ;
  366.                Mov    DI,BX                  ;resore Comment$ pointer
  367.                Mov    BX,SI                  ;Save Command Line pointer
  368.                Mov    SI,OFFSET DatBuffer    ;Point to Buffer
  369. Stuff_More:    Lodsb                         ;Get character from Buffer
  370.                Or     AL,AL                  ;End of data
  371.                Jz     Done_Stuff             ;Yes,
  372.                Stosb                         ;Copy to Comment$
  373.                Inc    CX                     ;Count it
  374.                Cmp    CX,62                  ;Maximum Length?
  375.                Jl     Stuff_More             ;No - Continue
  376.                Stc                           ;Yes - Indicate that
  377. Done_Stuff:    Mov    SI,BX                  ;Restore Command Line pointer
  378.                Pop    AX                     ;Restore Quote
  379.                Ret                           ;All done
  380.  
  381. ;------------------------------------------;
  382. ; This subroutine Reads Date and stuffs    ;
  383. ; buffer with information (uses part of    ;
  384. ; Do_Time routine)                         ;
  385. ;------------------------------------------;
  386.  
  387. Do_Date:       Push   BX             ;Save BX
  388.                Push   CX             ;Save Length
  389.                Push   DX             ;Save Message Pointer
  390.                Test   BiosDOS,0      ;Get flag
  391.                Jne    DosDate        ;We use DOS
  392.                Mov    AH,04H         ;Get date service
  393.                Int    1AH            ;Call BIOS - return codes as follows:
  394.                                      ;CH = Century (19-20)  CL = Year (00-99)
  395.                                      ;DH = Month   (1-12)   DL = Day  (00-31)
  396.                Jmp    SHORT Do_Date1
  397. DosDate:       Mov    AH,2AH         ;Get System Date
  398.                Int    21H            ;DOS Call
  399.                Sub    CX,1900        ;Remove Century
  400. Do_Date1:      Mov    AL,DH          ;Month
  401.                Call   ASCII          ;Convert byte to ASCII digits
  402.                Mov    AL,'-'         ;
  403.                Stosb                 ;
  404.                Mov    AL,DL          ;Day
  405.                Call   ASCII          ;Convert byte to ASCII digits
  406.                Mov    AL,'-'         ;
  407.                Stosb                 ;
  408.                Mov    AL,CL          ;Year
  409.                Jmp    SHORT Skip_Seconds
  410.  
  411. ;------------------------------------------;
  412. ; This subroutine Reads Time and stuffs    ;
  413. ; buffer with information                  ;
  414. ;------------------------------------------;
  415.  
  416. Do_Time:       Push   BX             ;Save BX
  417.                Push   CX             ;Save Length
  418.                Push   DX             ;Save Message Pointer
  419.                PushF                 ;Save Flags
  420.                Test   BiosDOS,0      ;Get flag
  421.                Jne    DosTime        ;We use DOS
  422.                Mov    AH,02H         ;Get time service
  423.                Int    1AH            ;Call BIOS - return codes as follows:
  424.                                      ;CH = Hours   (0-23)   CL = Minutes (0-59)
  425.                                      ;DH = Seconds (0-59)
  426.                Jmp    SHORT Do_Time1
  427. DosTime:       Mov    AH,2CH         ;Get System Time
  428.                Int    21H            ;DOS Call
  429. Do_Time1:      Mov    AL,CH          ;Hours
  430.                Call   ASCII          ;Convert byte to ASCII digits
  431.                Mov    AL,':'         ;
  432.                Stosb                 ;
  433.                Mov    AL,CL          ;Minutes
  434.                PopF                  ;Restore Flags
  435.                Jnc    Skip_Seconds   ;Skip the Seconds if No Carry
  436.                Call   ASCII          ;Convert byte to ASCII digits
  437.                Mov    AL,':'         ;
  438.                Stosb                 ;
  439.                Mov    AL,DH          ;Seconds
  440. Skip_Seconds:  Pop    DX             ;Restore Message Pointer
  441.                Pop    CX             ;Restore Length
  442.                Pop    BX             ;Restore BX
  443. ASCII:         Test   BiosDos,0      ;Do we use DOS or BIOS
  444.                Jne    DosASCII       ;We use DOS
  445.                Mov    AH,AL          ;Need to get BCD Digits
  446.                Shr    AL,1           ; MSD in AL
  447.                Shr    AL,1           ;  lower
  448.                Shr    AL,1           ;    4
  449.                Shr    AL,1           ;    Bits
  450.                And    AH,0FH         ;And LSD in AH cleanly
  451. PutAscii:      Or     AX,3030H       ;Convert to ASCII
  452.                Stosw                 ;Stuff Digits into Buffer (in reverse)
  453.                Ret                   ;SI Points to String Data
  454. DosASCII:      Mov    BL,10          ;Divide by 10
  455.                Xor    AH,AH          ;Change AL to AX
  456.                Div    BL             ;Do the Division
  457.                Jmp    PutAscii       ;and write the digits
  458.  
  459. ;--------------------------------------------;
  460. ; This subroutine will translate @ variables ;
  461. ; to data read from PCBOARD.SYS & USERS file ;
  462. ;--------------------------------------------;
  463.  
  464. VarSub:        Push   DI                     ;Save Comment$ pointer
  465.                Mov    BX,OFFSET SUB_TABLE    ;Point to Variable List
  466.                Mov    DI,OFFSET DatBuffer    ;Point to Buffer
  467. NextVar:       Mov    AH,[BX]                ;Get a letter from table
  468.                Or     AH,AH                  ;End of table?
  469.                Jz     NoSub                  ;Yes, no match then
  470.                Cmp    AH,AL                  ;No,  Is this our Letter?
  471.                Jz     GotIt                  ;     Yes,
  472.                Add    BX,4                   ;     No, Bump the pointer
  473.                Jmp    NextVar                ;         Next Variable
  474. GotIt:         Mov    AX,[BX][1]             ;Get Offset value from table
  475.                Mov    CL,[BX][3]             ;Get Length value from table
  476.                Xor    CH,CH                  ;Convert to word
  477.                Mov    BX,SI                  ;Save Command line pointer
  478.                Mov    SI,OFFSET SysBuffer    ;Point to PCBOARD.SYS Buffer
  479.                Add    SI,AX                  ;Add Offset
  480. VarCopy:       Lodsb                         ;Get Character
  481.                Or     AL,AL                  ;Is it a Zero
  482.                Jnz    CopyIt                 ;No,
  483.                Or     AL,ASCIIZ$             ;Yes, Is ASCIIZ$ = 0
  484.                Jz     CopyDone               ;     Yes, Done
  485. CopyIt:        Stosb                         ;     No,  Copy it
  486.                Loop   VarCopy                ;Loop till Done
  487. ;               Rep    Movsb                  ;Copy Variable to Buffer
  488. CopyDone:      Mov    SI,BX                  ;Restore Command line pointer
  489.                Pop    BX                     ;Restore Comment$ Pointer to BX
  490.                Jmp    Stuff_It               ; Now stuff the data in Comment$
  491. NoSub:         Pop    BX                     ;Restore Comment$ Pointer to BX
  492.                Jmp    S4                     ;Just store the character
  493.  
  494. ;--------------------------------;
  495. ; This subroutine will parse     ;
  496. ; leading and delimiting spaces. ;
  497. ;--------------------------------;
  498.  
  499. Space:         Inc    SI                     ;Point to next byte
  500.                Cmp    BYTE PTR [SI],' '      ;Is it space?
  501.                Jz     Space                  ;If no, get next byte
  502.                Ret                           ; else, return.
  503.  
  504. ;----------------------------;
  505. ; This subroutine will check ;
  506. ; for delimiter characters.  ;
  507. ;----------------------------;
  508.  
  509. Delimiter:     Push   AX
  510.                Mov    AL,[SI]
  511.                Clc                           ;Assume not delimiter.
  512.                Cmp    AL,' '                 ;Is it space
  513.                Jz     Set_Carry
  514.                Cmp    AL,CR                  ; or carriage return
  515.                Jz     Set_Carry
  516.                Cmp    AL,','                 ; or comma?
  517.                Jz     Set_Carry
  518.                Cmp    AL,';'                 ; or semi-colon?
  519.                Jz     Set_Carry
  520.                Cmp    AL,Switch              ; or Switch?
  521.                Jnz    Return                 ;If no, return else, indicate
  522. Set_Carry:     Stc                           ; by setting carry flag
  523. Return:        Pop    AX
  524.                Ret                           ; and return.
  525.  
  526. ;----------------------------;
  527. ; This subroutine will fill  ;
  528. ; the buffer with *'s.       ;
  529. ;----------------------------;
  530.  
  531. Do_Close:      Mov    DI,Offset DatBuffer    ;Point to Buffer for this
  532.                Mov    DX,DI                  ;DX also for Write
  533.                Mov    AL,'*'                 ;Make a line of *'s
  534.                Mov    CX,62                  ;Need 62 of them
  535.                Rep    Stosb                  ;
  536.                Mov    AL,CR                  ;Add a Carriage Return
  537.                Mov    AH,LF                  ;  and Line Feed
  538.                Stosw
  539.                Mov    Close_It,0FFh          ;Turn Off flag or we will be here
  540.                Ret                           ;  forever - and Return
  541.  
  542. ;---------------------------------------;
  543. ; This subroutine will use DOS function ;
  544. ; to print string terminated by Zero.   ;
  545. ;---------------------------------------;
  546.  
  547. DisplayText:   Lodsb                         ;get a character
  548.                Or     AL,AL                  ;End of name
  549.                Jz     DisplayDone            ;Yes, Done
  550.                Mov    DL,AL                  ;No,Print it
  551.                Mov    AH,2                   ;Character Output
  552.                Int    21H
  553.                Jmp    DisplayText            ;Loop until done
  554. DisplayDone:   Ret
  555.  
  556. ;---------------------------------------;
  557. ; This subroutine will read PCBOARD.SYS ;
  558. ; file into a buffer area.              ;
  559. ;---------------------------------------;
  560.  
  561. ReadFile:      Push   DI                     ;
  562.                Push   SI                     ;
  563.                Push   DX                     ;Save message pointer
  564.                Xor    CX,CX              ;Zero Counter for test purposes
  565. NextFlush:     Mov    BX,CX              ;Let's dup the Stdin handle
  566.                Mov    AH,45h             ;service to duplicate a file handle
  567.                Int    21h                ;call DOS to do it
  568.                Jcxz   StartFlush         ;First Time thru
  569.                Jmp    SHORT CloseIt
  570. StartFlush:    Mov    CX,AX              ;copy to CX for counter
  571. CloseIt:       Mov    BX,AX              ;put the new handle into BX
  572. ;               Mov    DX,AX              ;Copy Handle number
  573. ;               Add    DX,3030h           ;Make it Ascii
  574. ;               Mov    AH,2               ;Display Character
  575. ;               Int    21h                ;Let's display the number for testing
  576.                Mov    AH,3Eh             ;and close the "alias" file
  577.                Int    21h                ;call DOS to do it
  578.                Dec    CX                 ;Next Handle
  579.                Cmp    CX,4               ;Did we inherit any files?
  580.                Ja     NextFlush          ;Yes, lets Flush them
  581.                                          ;No, or we went thru them all!
  582. DoneFlushing:  Mov    DI,OFFSET SysBuffer    ;Point to PCBoard.Sys Buffer area
  583.                Push   DI
  584.                Mov    CX,1024                ;Let's fill the whole buffer area
  585.                Mov    AL,'.'                 ;  with '.' characters
  586.                Rep    Stosb                  ;    and do it
  587.                Mov    DX,OFFSET PCBoardSys$  ;Point to Asciiz filename
  588.                Call   CheckFile              ;See if it's present
  589.                Pop    DI
  590.                Mov    CX,128                 ;128 bytes is all we need
  591.                Xor    AX,AX                  ;No Record Seek
  592.                Call   ReadBuffer             ;
  593.                Jc     ReadErr_Hop            ;
  594.                Mov    AL,SysBuffer + 84      ;Get the first character (UserName)
  595.                Cmp    AL, ' '                ;Is it a space?
  596.                Je     NoUser                 ;Yes
  597.                Mov    DX,OFFSET PCBoardDat$  ;Point to Asciiz filename
  598.                Call   CheckFile              ;See if it's present
  599.                Mov    DI,OFFSET DatBuffer    ;Point to PCBoard.Dat Buffer area
  600.                Mov    CX,8000                ;8000 bytes is more than enough
  601.                Xor    AX,AX                  ;No Record Seek
  602.                Call   ReadBuffer
  603. ReadErr_Hop:   Jc     ReadError
  604.                Mov    DI,OFFSET DatBuffer    ;Point to PCBoard.Dat Buffer area
  605.                Mov    CX,8000
  606.                Mov    BX,28                  ;Scan past 28 Lines
  607.                Mov    AL,LF
  608. NextLine:      Repne  Scasb
  609.                Dec    BX
  610.                Jnz    NextLine
  611.                Mov    DX,DI                  ;DX points to filename
  612.                Repne  Scasb                  ;Find End of line
  613.                Dec    DI                     ;back up
  614.                Dec    DI                     ;back up
  615.                Mov    Byte Ptr [DI],0        ;Make ASCIIZ
  616. ;               Push   DX
  617. ;               Mov    SI,DX
  618. ;               Call   DisplayText            ;Lets see that name
  619. ;               Pop    DX
  620.                Mov    DI,OFFSET UserBuffer   ;Point to User File Buffer
  621.                Mov    CX,400                 ;400 Bytes in User Record
  622.                Mov    AX,Word Ptr SYSBuffer+23 ;Get User Record Number
  623.                Or     AX,AX                  ;Test the Record Number
  624.                Jz     NoUser                 ;None present, error
  625.                Push   AX                     ;Save the record Number
  626.                Call   ReadBuffer
  627.                Pop    CX
  628.                Jc     ReadError
  629.                Mov    AH,3EH                 ;Close file
  630.                Int    21H
  631.                Mov    DI,OFFSET UserBuffer+229 ;Point to LastMsgConf
  632.                Mov    SI,OFFSET UserBuffer+87  ;Point SI to Last Date On
  633.                Mov    AX,CX                  ;Get Record Number
  634.                Call   TransferInt2           ;Copy Integer
  635.                Call   TransferDate           ;Copy Date (DI=DI+8, SI=SI+6)
  636.                Add    SI,8                   ;Point to Last Scan Date
  637.                Call   TransferDate           ;Copy Date (DI=DI+8, SI=SI+6)
  638.                Call   TransferChr            ;Copy Chr$(Seclevel)
  639.                Call   TransferInt            ;Copy Integer (TimesOn)
  640.                Add    SI,73                  ;Point to Minutes On
  641.                Call   TransferInt            ;Copy Integer (Minutes On)
  642.                Call   TransferDate           ;Copy Date (DI=DI+8, SI=SI+6)
  643.                Call   TransferChr            ;Copy Chr$(ExpSecLevel)
  644.                Mov    AX,Word Ptr SYSBuffer+109 ;Get Time Remaining
  645.                Call   TransferInt2           ;Copy Integer
  646.                Mov    SI,OFFSET UserBuffer   ;Point SI to UserName
  647.                Call   TransferFile           ;Make it a FileName
  648.                Pop    DX                     ;Restore message pointer
  649.                Clc                           ;Indicate No Error
  650.                Jmp    SHORT ReadError2       ;
  651. NoUser:        Mov    DX, OFFSET NoUser$     ;No user Online!
  652.                Stc
  653. ReadError:     Pop    AX                     ;Forget message pointer
  654. ReadError2:    Pop    SI
  655.                Pop    DI
  656.                Ret
  657.  
  658. ;---------------------------------------;
  659. ; Transfer UserName to FileName         ;
  660. ;---------------------------------------;
  661.  
  662. TransferFile:  Mov    BL,'.'      ; We need a '.', then a 0h
  663.                Mov    BH,' '      ; First we need to find space
  664.                Mov    AH,254      ; Flag shows we are in FileName, then Ext.
  665.                Mov    CX,8        ; Eight Characters Max
  666.                Mov    DX,25       ; UserName is 25 characters long
  667. Next_Char:     Lodsb              ; Read a Char
  668.                Dec    DX          ; Count it
  669.                Call   CheckChar   ; Check for bad characters
  670.                Cmp    AL,BH       ; Is it a Space?
  671.                Jne    Not_Space   ; No, continue then
  672.                Inc    AH          ; Yes, Show we found a Space
  673. Do_Dot:        Mov    AL,BL       ; Yes, Time for the '.' or 0h
  674. Not_Space:     Stosb              ; Store the character
  675.                Cmp    AL,BL       ; Was it a '.'?
  676.                Je     Extension   ; Yes
  677.                Loop   Next_Char   ; No, then loop till all 8
  678.                Jmp    Do_Dot      ; And now we need a Dot
  679. Extension:     Or     BL,BL       ; Are we Done (BL = 0)?
  680.                Jz     FileDone    ; Yes, Bye-bye
  681.                Xor    BL,BL       ; Zero to BL
  682.                Inc    AH          ; No, Did we find a Space already?
  683.                Jz     Skip_Scan   ; Yes, then No need for scan!
  684.                Mov    CX,DX       ; No, Get Characters remaining in UserName
  685.                Xchg   SI,DI       ; Scasb needs ES:DI (but we want to scan SI)
  686.                Mov    AL,BH       ; Scan for a Space
  687.                Repne  Scasb       ; Do the scan
  688.                Xchg   SI,DI       ; Restore SI & DI (SI past the SPACE!)
  689.                Jne    End_File    ; Sorry, no Space found, end the name
  690.                Inc    AH          ; AH = 0 (else we exit!)
  691. Skip_Scan:     Mov    CX,3        ; Three characters MAX for extension
  692.                Jz     Next_Char   ; Back we go for the extension
  693. End_File:      Mov    [DI],BL     ; There isn't one, end the FileName here
  694. FileDone:      Ret
  695.  
  696. CheckChar:     Cmp    AL,BH       ; Space is OK
  697.                Je     Char_Ok
  698.                Cmp    AL,BH       ; '.' or 0h is OK
  699.                Je     Char_Ok
  700.                Cmp    AL,'0'      ; Ctrl-Chars !"#$%'&()*+,-./ are no good
  701.                Jb     Bad_Char
  702.                Cmp    AL,'9'      ; 0-9 are OK
  703.                Jbe    Char_Ok
  704.                Cmp    AL,'A'      ; ;:<=>? are no good
  705.                Jb     Bad_Char
  706.                Cmp    AL,'Z'      ; A-Z are OK
  707.                Jbe    Char_Ok     ; Anything else is no good
  708. Bad_Char:      Mov    AL,'$'      ; Replace all bad characters with '$'
  709. Char_Ok:       Ret
  710.  
  711. ;---------------------------------------;
  712. ; Transfer Date from yymmdd to mm-dd-yy ;
  713. ;---------------------------------------;
  714.  
  715. TransferDate:  Mov    BL,'-'
  716.                Lodsw              ; Read Year
  717.                Movsw              ; Copy Month
  718.                Mov    [DI],BL     ; Write '-'
  719.                Inc    DI
  720.                Movsw              ; Copy Day
  721.                Mov    [DI],BL     ; Write '-'
  722.                Inc    DI
  723.                Stosw              ; Write year
  724.                Ret
  725.  
  726. ;------------------------------------------;
  727. ; This subroutine will converts a byte     ;
  728. ; into ascii text                          ;
  729. ;------------------------------------------;
  730.  
  731. TransferChr:   Lodsb                  ;Read the Chr
  732.                Xor    AH,AH           ;force upper byte to zero
  733.                Mov    DX,3            ;We want 3 characters
  734.                Jmp    SHORT TI2
  735.  
  736. ;------------------------------------------;
  737. ; This subroutine will converts an integer ;
  738. ; into ascii text                          ;
  739. ;------------------------------------------;
  740.  
  741. TransferInt:   Lodsw                  ;Read the integer
  742. TransferInt2:  Mov    DX,5            ;We want 5 characters
  743. TI2:           Push   BX              ;Save register
  744.                Mov    BL,10           ;for division by 10
  745.                Xor    CX,CX           ;set count to zero
  746. Divide:        Push   DX              ;save register
  747.                Xor    DX,DX           ;perform word divide
  748.                Xor    BH,BH           ;  to avoid divide overflow
  749.                Div    BX              ;return quotient in AX
  750.                Mov    BH,DL           ;return remainder in BH
  751.                Pop    DX
  752.                Push   BX              ;build our number on the stack
  753.                Inc    CX              ;keep count of them
  754.                Or     AX,AX           ;All done? (remainder = 0)
  755.                Jnz    Divide          ;No, Keep dividing
  756.                Mov    AH,"0"          ;prepare for ASCII translation
  757. Write_it:      Pop    BX              ;get a remainder off the stack
  758.                Mov    AL,BH           ;put remainder in AL
  759.                Add    AL,AH           ;convert to ASCII
  760.                Stosb                  ;write digit to end of string
  761.                Dec    DX              ;decrement desired count
  762.                Loop   Write_it        ;pop all of them off of stack
  763.                Mov    CX,DX           ;Remaining Count to CX
  764.                Pop    BX              ;Retore register
  765.  
  766.                Jcxz   PadDone         ;No padding needed
  767.                Xor    AL,AL           ;Load Zero
  768.                Rep    Stosb           ;Pad remainder
  769. PadDone:       Ret                    ;All Done!
  770.  
  771.  
  772. ;-------------------------------------------;
  773. ; DX Points to ASCIIZ Filename              ;
  774. ;                                           ;
  775. ; Check to see if file in current directory ;
  776. ; or at %PCBDRIVE%%PCBDIR% from environment ;
  777. ;-------------------------------------------;
  778.  
  779. CheckFile:     Push   DX              ;Save filename pointer
  780.                Mov    AX,3D40H        ;Open file for reading.
  781.                Int    21H
  782.                Jc     CheckError      ;Error if Carry Set
  783.                Mov    AX,BX           ;Copy handle of open file
  784.                Mov    AH,3Eh          ;and close it.
  785.                Int    21H
  786.                Jnc    CheckDone       ;OK, File exists
  787. CheckError:    Cmp    AX,2            ;File Not Found?
  788.                Jne    CheckDone       ;Exit if anything else
  789.                Mov    BX,OFFSET UserBuffer
  790.                Pop    SI              ;Get filename pointer
  791.                Push   BX              ;Save Buffer Address instead
  792.                Push   SI              ;Now save filename pointer
  793.                Mov    DX,OFFSET PCBDrive
  794.                Mov    BP,LenPCBDrive
  795.                Call   Copy_Env        ;Findit & Copy it
  796.                Mov    DX,OFFSET PCBDir
  797.                Mov    BP,LenPCBDir
  798.                Call   Copy_Env        ;Findit & Copy it
  799.                Pop    SI              ;Get back filename pointer
  800.                Mov    AL,'\'          ;Append a '\' (if needed)
  801.                Cmp    [DI-1],AL       ;Is there one already?
  802.                Je     No_Slash        ;Yes,
  803.                Stosb                  ;No,  so add one.
  804. No_Slash:      Call   Copy_ASCIIZ     ;And Copy it
  805.                Stosb                  ; And terminate it with a Zero
  806. ;               Pop    SI              ;Get the buffer address
  807. ;               Push   SI              ; put it back on the stack
  808. ;               Call   DisplayText     ; Now, Lets see that name!
  809. CheckDone:     Pop    DX              ;Get Filename pointer or buffer address.
  810.                Ret
  811.  
  812. ;------------------------------------------------------;
  813. ; On Entry:                                            ;
  814. ;    BX Points to Destination Buffer                   ;
  815. ;    DX points to Target String to find in Environment ;
  816. ;    BP Contains length of Target String               ;
  817. ; On Exit:                                             ;
  818. ;    BX adjusted to next character to write in Buffer  ;
  819. ;    DI is same as BX (All other Regs altered)         ;
  820. ;------------------------------------------------------;
  821.  
  822. Copy_Env:      Mov    AX,CS:[2Ch]       ;Point ES to Environment
  823.                Mov    ES,AX             ;
  824.                Xor    DI,DI             ;Start of Environment (ES:DI)
  825.                Xor    AX,AX             ;
  826. Next_Env:      Mov    CX,BP             ;Get length.
  827.                Mov    SI,DX             ;Get Target pointer
  828.                Rep    Cmpsb             ;Do we have a match? (DS:SI) = (ES:DI)
  829.                Je     FoundMatch        ;Yes, Found it
  830.                Dec    DI                ;No,  It didn't match, back up one
  831.                Mov    CX,-1             ;
  832.                Repne  Scasb             ;Find the end of this one (ES:DI)
  833.                Cmp    ES:[DI],AL        ;Is this the last one?
  834.                Jne    Next_Env          ;No, Do the next one.
  835.                Mov    DI,BX             ;Point DI to Buffer also
  836.                Je     Copy_Exit         ;Yes, No Copy
  837.  
  838. FoundMatch:    Mov    AX,ES             ;Point DS to Env Segment
  839.                Mov    DS,AX             ;
  840.                Mov    AX,CS             ; and ES back to Program Data Segment
  841.                Mov    ES,AX             ;
  842.                Mov    SI,DI             ;Point SI to variable value
  843.                Mov    DI,BX             ;Point DI to Buffer
  844.  
  845. Copy_ASCIIZ:   Xor    AL,AL             ;We need to copy up to the 0h
  846. Copy_Next:     Cmp    [SI],AL           ;Is this the end?
  847.                Je     Copy_Done         ;Yes,
  848.                Movsb                    ;No, Copy it (ES:DI) <= (DS:SI)
  849.                Jne    Copy_Next         ;Keep going
  850. Copy_Done:     Mov    BX,DI             ;Update BX
  851. Copy_Exit:     Mov    DX,CS             ;Make sure DS points to
  852.                Mov    DS,DX             ;  Code Segment again.
  853.                Mov    ES,DX             ;  and ES too!
  854.                Ret                      ;
  855.  
  856. ;--------------------------------;
  857. ; DX Points to ASCIIZ Filename   ;
  858. ; DI Points to Buffer Area       ;
  859. ; CX Contains Length to read     ;
  860. ; AX Contains Record Number or 0 ;
  861. ; Carry set if error             ;
  862. ;--------------------------------;
  863.  
  864. ReadBuffer:    Mov    SI,DX                  ;Save filename pointer (for disp)
  865.                Push   AX                     ;Save Record Number (if any)
  866.                Mov    AX,3D40H               ;Open file for reading.
  867.                Int    21H
  868.                Pop    BX                     ;Restore Record Number (to BX)
  869.                Jc     FileError              ;Error if Carry Set
  870.                Xchg   AX,BX                  ;Copy handle of open file
  871.                Or     AX,AX                  ;Random Record Seek?
  872.                Jz     No_Seek                ;No,
  873.                Push   CX
  874.                Dec    AX
  875.                Mul    CX                     ;Yes, CX=Length, AX=Record Number
  876.                                              ;Now DX:AX = Seek (Save Length)
  877.                Mov    CX,AX                  ;Now DX:CX
  878.                Xchg   CX,DX                  ;Now CX:DX
  879.                Mov    AX,4200H               ;Seek
  880.                Int    21H
  881.                Pop    CX                     ;Restore Length
  882.                Jc     FileError              ;Error if Carry Set
  883. No_Seek:       Mov    DX,DI                  ;Point to buffer
  884.                Mov    AH,3FH                 ;Read from handle
  885.                Int    21H
  886.                Jc     FileError              ;Error if Carry Set
  887.                Mov    AH,3EH                 ;Close file
  888.                Int    21H
  889.                Jc     FileError
  890.                Ret                           ;All done
  891. FileError:     Push   AX                     ;Save error code
  892.                Call   DisplayText            ;Display the filename
  893.  
  894. ;For trouble shooting error codes use the following
  895.  
  896. ;               Mov    DL,' '
  897. ;               Mov    AH,2                   ;Character Output
  898. ;               Int    21H
  899. ;               Mov    DL,'('
  900. ;               Mov    AH,2                   ;Character Output
  901. ;               Int    21H
  902. ;               Mov    DL,BL
  903. ;               Add    DL,30h
  904. ;               Mov    AH,2                   ;Character Output
  905. ;               Int    21H
  906. ;               Mov    DL,')'
  907. ;               Mov    AH,2                   ;Character Output
  908. ;               Int    21H
  909.                Pop     AX                    ;Get error code
  910.                Call    File_Error            ;Translate it
  911.                Stc                           ;Indicate the error
  912.                Ret
  913.  
  914. SUB_TABLE              LABEL BYTE
  915.                DB     'F',  25, 0, 15          ; First Name (Proper Case)
  916.                DB     '?',  40, 0, 12          ; Password
  917.                DB     'G',  56, 0,  5          ; Time User logged On
  918.                DB     'Z',  80, 0,  4          ; Language Extension
  919.                DB     'N',  84, 0, 25          ; User Full Name
  920.                DB     '*', 146, 1,  5          ; Time Remaining (from 109)
  921.                DB     'V', 112, 0,  5          ; Event Time
  922.                DB     'C', 153, 0, 24          ; City, State
  923.                DB     'B', 189, 0, 13          ; Bus/Data Phone
  924.                DB     'H', 202, 0, 13          ; Home/Voice Phone
  925.                DB     'D', 106, 1,  8          ; Last Date On (from 215)
  926.                DB     'T', 221, 0,  5          ; Last Time On
  927.                DB     '!', 226, 0,  1          ; Expert Mode (Y or N)
  928.                DB     'P', 227, 0,  1          ; Default Protocol
  929.                DB     'L', 114, 1,  8          ; Last Dir Scan (from 229)
  930.                DB     'A', 122, 1,  3          ; Sec Level Access (from 235)
  931.                DB     '#', 125, 1,  5          ; Number of Times On (from 236)
  932.                DB     'M', 130, 1,  5          ; TimeSpent last call (from 311)
  933.                DB     'E', 135, 1,  8          ; Expiration Date  (from 313)
  934.                DB     'X', 143, 1,  3          ; Expiration Sec Level (from 319)
  935.                DB     'U', 251, 0, 30          ; User Maintained Comment
  936.                DB     'S',  25, 1, 30          ; Sysop Maintained Comment
  937.                DB     'R', 101, 1,  5          ; Record Number
  938.                DB     '=', 151, 1, 13          ; First.Last
  939.                DB     '$', 101, 1, 63          ; Translated Data
  940.  
  941. Table_End      DB     0    ; 528 DUP ('.')     ;PCBoard.Sys reads in here
  942. SysBuffer      EQU    Table_End + 1
  943.  
  944. ;    0 Display AS STRING * 2   'Display On/Off ("-1" = On, " 0" = Off)
  945. ;    2 Printer AS STRING * 2   'Printer On/Off ("-1" = On, " 0" = Off)
  946. ;    4 PageBell AS STRING * 2  'Page Bell On/Off ("-1" = On, " 0" = Off)
  947. ;    6 CallAlarm AS STRING * 2 'Caller Alarm On/Off ("-1" = On, " 0" = Off)
  948. ;    8 SysopFlag AS STRING * 1 'Sysop Flag (" ", "N"=sysop next, "X"=exit dos)
  949. ;    9 ErrCorr AS STRING * 2   'Error Corrected ("-1" = On, " 0" = Off)
  950. ;   11 Graphics AS STRING * 1  'Graphics Mode ('Y'=yes, 'N'=no, '7'=7E1)
  951. ;   12 NodeChat AS STRING * 1  'Node Chat Status ('A'=available, 'U'=unavailable)
  952. ;   13 DTEPort  AS STRING * 5  'DTE Port Speed (PC to Modem speed)
  953. ;   18 Connect  AS STRING * 5  'Connect Speed shown to caller or "Local"
  954. ;|  23 RecNum   AS INTEGER     'User's Record Number in the USERS file
  955. ;|  25 FirstName AS STRING * 15 'User's First Name (padded to 15 characters)
  956. ;|  40 Password AS STRING * 12 'User's Password (padded to 12 characters)
  957. ;   52 TimeOn   AS INTEGER     'Time User Logged On (in minutes since midnight)
  958. ;   54 TimeUsed AS INTEGER     'Time used so far today (negative number of minutes)
  959. ;|  56 TimeOnF  AS STRING * 5  'Time User Logged On (in "HH:MM" format)
  960. ;   61 DayTime  AS INTEGER     'Time Allowed On (from PWRD file)
  961. ;   63 DLKbytes AS INTEGER     'Allowed K-Bytes for Download
  962. ;   65 ConfArea AS STRING * 1  'Conference Area user was in (if <= 255)
  963. ;   66 ConfJoined AS STRING * 5 'Conference Areas the user has joined this session
  964. ;   71 ConfScaned AS STRING * 5 'Conference Areas the user has scanned this session
  965. ;   76 ConfAddTime AS INTEGER  'Conference Add Time in minutes
  966. ;   78 CreditTime AS INTEGER   'Upload/Sysop CHAT Credit Minutes
  967. ;|  80 LangExt AS STRING * 4   'Language Extension
  968. ;|  84 UserName AS STRING * 25 'User's Full Name (padded to 25 characters)
  969. ;| 109 MinRemain AS INTEGER    'Calculated Minutes Remaining
  970. ;  111 NodeNum AS STRING * 1   'Node Number (or ' ' if no network)     CHR$()
  971. ;| 112 EventTime AS STRING * 5 'Scheduled Event Time (in "HH:MM" format)
  972. ;  117 EventOn AS STRING * 2   'Is Event Active ("-1" = On, " 0" = Off)
  973. ;  119 EventSlide AS STRING * 2 'Slide Event ("-1" = On, " 0" = Off)
  974. ;  121 MemMesg AS STRING * 4   'Memorized Message Number               MKSMBF$()
  975. ;  125 ComPort AS STRING * 1   'Comm Port Number (0=none, 1-8)
  976. ;  126 Reserved1 AS STRING * 1 'Reserved for PCBoard
  977. ;  127 Reserved2 AS STRING * 1 'Reserved for PCBoard
  978.  
  979. UserBuffer     EQU    SysBuffer+128            ;Users record reads in here
  980.  
  981. ;| 128 UserName AS STRING * 25      'First name and Last name
  982. ;| 153 CityState AS STRING * 24     'City and State
  983. ;  177 Password AS STRING * 12      'Password
  984. ;| 189 BusPhone AS STRING * 13      'Business Phone Number
  985. ;| 202 HomePhone AS STRING * 13     'Home Phone Number
  986. ;| 215 LastOnDate AS STRING * 6     'Last Date on system (in yymmdd format)
  987. ;| 221 LastOnTime AS STRING * 5     'Last Time on system (in hh:mm format)
  988. ;| 226 Expert AS STRING * 1         'Expert Mode - "Y" or "N"
  989. ;| 227 Protocol AS STRING * 1       'Protocol
  990. ;  228 PackedFlags AS STRING * 1    'Dirty, ClrScrn, HasMail, DontAsk, Editor
  991. ;| 229 LastDirScan AS STRING * 6    'Last date looked at directory (in yymmdd format)
  992. ;| 235 SecLevel AS STRING * 1       'Security Level CHR$(X)
  993. ;| 236 TimesOn AS INTEGER           'Number of times on the system
  994. ;  238 PageLength AS STRING * 1     'Page Length CHR$(X)
  995. ;  239 Uploads AS INTEGER           'Number of Uploads
  996. ;  241 Downloads AS INTEGER         'Number of Downloads
  997. ;  243 DailyDlBytes AS STRING * 8   'Daily Download Bytes so far
  998. ;| 251 UserComment AS STRING * 30   'User Maintained Comment
  999. ;| 281 SysopComment AS STRING * 30  'Sysop Maintained Comment
  1000. ;| 311 TimeSpent AS INTEGER         'Elapsed Time on system on last date called
  1001. ;| 313 SubDate AS STRING * 6        'Subscription Registration Date (yymmdd format)
  1002. ;| 319 ExpSecLevel AS STRING * 1    'Subscription Expired Security Level CHR$(X)
  1003. ;  320 LastConference AS STRING * 1 'Last Conference left - CHR$(X) - 255 = Ext.
  1004. ;  321 AreaReg AS STRING * 5        'Area Registration Info (1-39) BitMap
  1005. ;  326 ExpAreaReg AS STRING * 5     'Expired Area Registration Info (1-39) BitMap
  1006. ;  331 UserScanArea AS STRING * 5   'User Message Scan Areas (1-39) BitMap
  1007. ;  336 TotalDownloads AS STRING * 8 'Total Bytes Download - all calls
  1008. ;  344 TotalUploads AS STRING * 8   'Total Bytes Upload - all calls
  1009. ;  352 Delete AS STRING * 1         'Positive Delete Flag to Delete User (Repack)
  1010. ;  353 LastMsgMain AS STRING * 4    'Last message read in Main Board     MKSMBF$()
  1011. ;  357 LastMsgConf AS STRING * 156  'Last message read in Conferences 39 * 4  "
  1012. ;                                   ' (Gets overwritten by 3 date conversions)
  1013. ;                                   ' ( & numeric conversions)
  1014. ;  513 InfPointer AS LONG           'Pointer into USERS.INF record
  1015. ;  517 Space2 AS STRING * 9         'Reserved
  1016. ;  526 ExtLastConference AS INTEGER 'Last Conference Left (If LastConf.$ = 255)
  1017.  
  1018. DatBuffer      EQU    UserBuffer+400           ;PCBoard.Dat read in here
  1019.                                                ;and we buffer or conversions.
  1020.  
  1021. CODE ENDS
  1022. END  Start
  1023.